cmake_minimum_required(VERSION 3.20.0)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)

project(ColorImage)

aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR} Source_File_List)

if (EMSCRIPTEN) 
    set(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/web)
    add_link_options(-O3 -lembind -sWASM=0 -sMODULARIZE=1 -sEXPORT_NAME=${PROJECT_NAME} -sENVIRONMENT=web)
    add_executable(${PROJECT_NAME} ${Source_File_List})
else()
    add_library(${PROJECT_NAME} ${Source_File_List})
endif()
